animation in javascript examples with code